// pages/shoppingCart/childCpns/w-cart-list/w-cart-list.js

const app = getApp();

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: []
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    checkboxChange(event) {
      app.changeGoodsCheck(event.detail.value);
      this.triggerEvent("handleChangeGoods");
    },
    handleDecremental(event) {
      let dataset = event.currentTarget.dataset;
      app.changeGoodsCount(dataset.iid, dataset.xdSkuId, -1);
      this.triggerEvent("handleChangeGoods");
    },
    handleIncremental(event) {
      let dataset = event.currentTarget.dataset;
      app.changeGoodsCount(dataset.iid, dataset.xdSkuId, 1);
      this.triggerEvent("handleChangeGoods");
    }
  }
})